/* -----------------
* brief
* 1. this is code gen by tools
* 2. mvc code are driver by the model defined with the same filename,
	 for example:
	 there is a Xmodel struct define in xmodel.go file, after the script run (lego model-mvc module_name xmodel)
     it will auto create the code under the module's path
	 m --> xmodel.go
	 v --> view
	 c --> xmodel_ctrl
* 3. you should modify this code if it doesn't satisfy your purpose
*/

package controller

import (
	"github.com/mjiulee/lego"
	"saas_sys_base/common"

	wechatCtrl "saas_sys_base/modules/wechat/controller"
)

type AppMemberCardApiCtrl struct {
	common.AppCtrlBase
	wechatCtrl.WechatCardApiCtrl // TODO 用组合还是继承，这个要考虑一下
}

var _ common.AppCtrlBaseInterface = (*AppMemberCardApiCtrl)(nil) //编译时检测是否实现了接口函数

func init() {
	vc := new(AppMemberCardApiCtrl)
	vc.InitApp(common.APP_ID_MEMBER_CARD)
	//vc.WechatTemplateService = WechatService.NewWechatService()
	_ctrlList = append(_ctrlList, vc)
}

func (vc *AppMemberCardApiCtrl) CtrlInfo() string {
	return "WechatCardApiCtrl"
}

func (vc *AppMemberCardApiCtrl) RoutInit() {
	//lego.APIPOSTv2("/api/wechat/card/create_card2", vc.CreateCard2, false)
	lego.APIPOST("/api/app/membercard/card/create", vc.AppCtrlMiddleware(vc.WechatCardApiCtrl.CreateCard), true)
	lego.APIPOST("/api/app/membercard/card/batchget", vc.AppCtrlMiddleware(vc.WechatCardApiCtrl.BatchGet), true)
	lego.APIPOST("/api/app/membercard/card/get", vc.AppCtrlMiddleware(vc.WechatCardApiCtrl.GetCard), true)
	lego.APIPOST("/api/app/membercard/card/qrcode/create", vc.AppCtrlMiddleware(vc.WechatCardApiCtrl.CreateCardQrCode), true)
	lego.APIPOST("/api/app/membercard/card/membercard/activateuserform/set", vc.AppCtrlMiddleware(vc.WechatCardApiCtrl.SetActivateUserForm), true)
}
